package calendar.view.panels;

import calendar.model.CalendarModel;
import com.google.api.services.calendar.model.Event;
import com.google.api.services.calendar.model.Events;
import swing.StackPanel;

import java.awt.*;
import java.util.List;

public class EventsStackPanel extends StackPanel<Events, Event> {
    public EventsStackPanel() {
        CalendarModel.EVENTS.addObserver(this);
    }

    @Override
    protected Component createItemPanel(Event item) {
        return new EventGridPanel(item);
    }

    @Override
    protected List<Event> parse(Events events) {
        return events.getItems();
    }
}
